package net.cmkj.mine.util;

import net.cmkj.mine.bean.SysUser;

import javax.servlet.http.HttpSession;

/**
 * session工具
 *
 * @author cmkj
 */
public class SessionKit {

    private static ThreadLocal<HttpSession> tl = new ThreadLocal<HttpSession>();

    public static void put(HttpSession s) {
        tl.set(s);
    }

    public static HttpSession get() {
        return tl.get();
    }

    public static void remove() {
        tl.remove();
    }

    public static SysUser getCurrentLoginUser() {
        return (SysUser) get().getAttribute("sysUser");
    }

}
